namespace go admin_menu
include "error_code.thrift"
include "common.thrift"
struct AdminMenuBuild{
	2:  string               Name        (api.body = "name")
	3:  bool                 AlwaysShow  (api.body = "always_show")
	1:  list<AdminMenuBuild> Children    (api.body = "children")
	4:  string               Component   (api.body = "component")
	5:  i64                  Hidden      (api.body = "hidden")
	6:  string               Path        (api.body = "path")
	7:  string               Redirect    (api.body = "redirect")
	8:  AdminMenuBuildMeta   Meta        (api.body = "meta")
}

struct AdminMenuBuildMeta{
	1:  string Title    (api.body = 'title')
	2:  string Icon     (api.body = 'icon')
	3:  i64    NoCache  (api.body = 'no_cache')
}

struct MenuBuildRequest{
	2:  string Name  (api.body = 'name')
}

struct MenuBuildResponse{
	1:  error_code.ErrorCode Code  (api.body = 'code')
	2:  list<AdminMenuBuild> Data  (api.body = 'data')
}

struct AdminMenu{
	1:   i64             ID            (api.body = 'id')
	2:   string          Name          (api.body = 'name')
	3:   string          Component     (api.body = 'component')
	4:   i64             PID           (api.body = 'pid')
	5:   i64             Sort          (api.body = 'sort')
	6:   string          Icon          (api.body = 'icon')
	7:   string          Path          (api.body = 'path')
	8:   i64             Hidden        (api.body = 'hidden')
	9:   string          Permission    (api.body = 'permission')
	10:  common.MenuType Type          (api.body = 'type')
	11:  string          Router        (api.body = 'router')
	12:  string          RouterMethod  (api.body = 'router_method')
	13:  list<AdminMenu> Children      (api.body = 'children')
	14:  string          Label         (api.body = 'label')
}

struct GetMenuListRequest{
	1: optional string Name  (api.query = 'name')
}

struct GetMenuListResponse{
	1:  error_code.ErrorCode Code  (api.body = 'code')
	2:  list<AdminMenu>      Data  (api.body = 'data')
}

struct DeleteMenuRequest{
	1:  list<i64> IDs  (api.body = "ids")
}

struct DeleteMenuResponse{
	1:  error_code.ErrorCode Code  (api.body = 'code')
}

struct CreateMenuRequest{
	1:   i64             Cache          (api.body = 'cache')
	2:   string          Component      (api.body = 'component')
	3:   string          ComponentName  (api.body = 'component_name')
	4:   i64             Hidden         (api.body = 'hidden')
	5:   string          Icon           (api.body = 'icon')
	6:   i64             Iframe         (api.body = 'iframe')
	7:   string          Name           (api.body = 'name')
	8:   string          Path           (api.body = 'path')
	9:   string          Permision      (api.body = 'permission')
	10:  i64             PID            (api.body = 'pid')
	11:  list<string>    Roles          (api.body = 'roles')
	12:  string          Router         (api.body = 'router')
	13:  string          RouterMethod   (api.body = 'router_method')
	14:  i64             Sort           (api.body = 'sort')
	15:  common.MenuType Type           (api.body = 'type')
}

struct CreateMenuResponse{
	1:  error_code.ErrorCode Code  (api.body = 'code')
}
